package com.tutu.thymeleaf.controller;

import com.tutu.thymeleaf.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

/**
 * @Program: SpringBoot
 * @Description: 模板属性
 * @Author: JK.TuTu
 * @ @Version: 1.0
 * @Create: 2022-11-30 12:27
 **/
@Controller
@RequestMapping("property")
public class TestController02 {

    /**
     * 模板属性
     * @param model
     * @return
     */
    @GetMapping("test01")
    public String test01(Model model) {
        model.addAttribute("textColor", "color:cyan");
        model.addAttribute("paramName", "name");
        model.addAttribute("value", "张三");
        model.addAttribute("methodAttr","post");
        return "demo04";
    }


    @RequestMapping("login")
    @ResponseBody
    public User login(@RequestParam User user){
        return user;
    }
}
